<template>
  <div>
    吸烟<input type="checkbox" v-model="hobby" value="吸烟"><br>
    喝酒<input type="checkbox" v-model="hobby" value="喝酒"><br>
    烫头<input type="checkbox" v-model="hobby" value="烫头"><br>
    你的选择是:{{hobby}}<br>
    <button @click="dj">点击切换</button>
    <span v-if="flag">
      你好Vue
    </span>
    <span v-if="!flag">
      你好,张三
    </span>
  </div>
</template>

<script>
export default {
  name: "ZkView",
  data() {
    return {
      hobby:[],
      flag:true,
    }
  }, methods: {
    dj(){
      this.flag=!this.flag;
    }
  }, created() {

  },beforeCreate() {
    console.log("1,beforeCreate")
  },beforeMount() {
    console.log("2,beforeMount")
  },mounted() {
    console.log("3,mounted")
  }
}
</script>

<style scoped>

</style>